"""cdk URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  url(r'^$', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  url(r'^$', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.conf.urls import url, include
    2. Add a URL to urlpatterns:  url(r'^blog/', include('blog.urls'))
"""
from django.conf.urls import url,include
from django.contrib import admin
from django.views.generic import  TemplateView
from django.views.static import serve
from cdk.settings import MEDIA_ROOT
import xadmin
from users.views import *
from organization.views import *
urlpatterns = [
    url(r'^course/', include('course.urls', namespace='course')),
    url(r'^xadmin/', xadmin.site.urls),
    url(r'^registerPage/', RegisterView.as_view(), name='registerPage'),
    url(r'register/',RegisterView.as_view(),name='register'),
    url(r'^login/', LoginView.as_view(), name='login'),
    # url(r'^$', TemplateView.as_view(template_name='index.html'),name='index'),
    url(r'^$', IndexView.as_view(),name='index'),
    url(r'^loginPage/', TemplateView.as_view(template_name='login.html'),name='loginPage'),
    url(r'^logout/', LogoutView.as_view(), name='logout'),
    # 验证码url
    url(r'^captcha/', include('captcha.urls')),
    # 邮箱验证
    url(r'^emailActivate/(.+)/$',emailVerify),
    # 找回密码页面
    url(r'^forgetPwdLink/$',findPwdBackView.as_view(),name='findPwdBack'),
    # 密码重置页
    url(r'^reSetPwdByEmailVerify/(.+)/$',pwdBackVerify,name='reSetPwdByEmailVerify'),
    # 密码重置请求
    url(r'^pwdResetRequest/',pwdReset,name='resetPwd'),
    # 个人中心
    url(r'^userInfoCenter/$',infoCenter,name='infoCenter'),
    # 修改个人资料
    url('^editInfo/$', editInfo, name='editInfo'),
    url(r'^uploadAvatar/$', UploadImageView.as_view(), name="image_upload"),
    # 机构列表
    url(r'^org_list/',OrgView.as_view(),name='org_list'),
    # media
    url(r'^media/(?P<path>.*)$', serve, {"document_root": MEDIA_ROOT}),
    # 修改邮箱
    url(r'^alterEmail/$',alterEmail,name='alterEmail'),
    # 修改邮箱验证
    url(r'^alterEmailVerify/(.+)/(.+)/$',alterEmailVerify,name='alterEmail'),


]
